// TestDlg.cpp : implementation file
//

#include "stdafx.h"
#include "test2.h"
#include "TestDlg.h"


// TestDlg dialog

IMPLEMENT_DYNAMIC(TestDlg, CDialog)

TestDlg::TestDlg(CWnd* pParent /*=NULL*/)
	: CDialog(TestDlg::IDD, pParent),
	  char_(0)
{

}

TestDlg::~TestDlg()
{
}

void TestDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(TestDlg, CDialog)
//	ON_BN_CLICKED(IDOK, &TestDlg::OnBnClickedOk)
END_MESSAGE_MAP()

wchar_t TestDlg::GetChar()
{
	return char_;
}


// TestDlg message handlers

BOOL TestDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  Add extra initialization here
	((CEdit*)GetDlgItem(IDC_EDIT1))->LimitText(1);

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
void TestDlg::OnOK()
{
	// TODO: Add your specialized code here and/or call the base class
	CString str;
	((CEdit*)GetDlgItem(IDC_EDIT1))->GetWindowText(str);

	if (str.GetLength() > 0)
	{
		char_ = str.GetAt(0);
	}


	CDialog::OnOK();
}
